<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>  
<jsp:useBean id="twitterBean" class="ar.edu.itba.twiteros.bean.TwitterosBean" scope="page"/>


<fb:header>Welcome to Twiteros</fb:header>


<h1>Follow <a href='http://twitter.com/<c:out value="${user.screenName}"/>'><c:out value="${user.name}"/></a> on twitter </h1><h1 style="text-align: right"><a href='http://apps.facebook.com/twiteros/'>Go To Twiteros</a></h1>

<br/>
<h3>The 10 most recent status updates:</h3>
<br/>
<c:choose>
	<c:when test="${access}">
		<table>
		<c:forEach items="${statuses}" var="status">
			<tr>
			<td>					
				<img src='<c:out value="${status.user.profileImageURL}" escapeXml="true" />'/>
			</td>
			<td>
				<b><c:out value="${status.user.name}"/></b>
				<br/> 
				<c:set var="message" value="${status.text}"/>
				<jsp:useBean id="message" type="java.lang.String" />
				<%= twitterBean.parseUrl(message) %>
				<br/>
				 <br />
				<c:set var="created" value="${status.createdAt}"/>
				<jsp:useBean id="created" type="java.util.Date" />
				<%= twitterBean.diference(created) %>
				
			</td>
			</tr>
		</c:forEach>
		</table>
	</c:when>
</c:choose>
